package com.imooc.security.demo.annotation;

import com.imooc.security.demo.validator.MyConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 自定义校验注解
 * @author JackYang
 * @description:
 * @create: 2020/6/13 20:25
 */
@Target(value = ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
//指定当前注解的校验类
@Constraint(validatedBy = MyConstraintValidator.class)
public @interface MyConstraint {
    
    String message() default "{校验失败啦啦}";
    
    Class<?>[] groups() default { };
    
    Class<? extends Payload>[] payload() default { };
}
